<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp" %>

<head>
	<title>update Users</title>
	<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
	<link  rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
	<script src="<c:url value="/javascripts/common.js"/>" ></script>
</head>

<body><div class="page"><%@include file="../top_menu.jsp"%><table width=100%>
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/payee_menu.jsp" /></td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>

</table><div class="contentArea">
<table border=0 cellpadding=0 cellspacing=0 width=100%> 
<tr><td valign="top"> 
</td> 
<td valign="top">

    
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    	<tr><td colspan="2">
		<%@include file="/WEB-INF/jsp/include/header.jsp"%>
		</td>
			</tr>
		<tr><td >
				<c:import url="/WEB-INF/jsp/include/provider.jsp" />
				</td>
				<td >
				&nbsp;
				</td>
			</tr>
    	<tr><td colspan="2" align="center"><h2>Payee Management</h2></td></tr> 
        
		<tr><td>&nbsp;</td></tr>

		<tr><td colspan="2">
		<form:form commandName="payee" method="post" onsubmit="return validatePassword()">
			<table border="1" cellpadding="4" cellspacing="1" width="80%">	
			    <tr bgcolor="#E9E9E9">
			    	<td colspan="2" align="left"><b>Update Payee</b>
			    	</td>
			    </tr>
			    
			    <tr>
			    	<td>Payee ID</td>
			    	<td><form:input   path="id" readonly="true" size="40" /></td>
			    	
			    </tr>
			    			    
			    <tr>
			    	<td align="left" width="40%">Role</td>
			    	<td>
						<form:select path="role.id">
							<c:forEach items="${roleList}" var="item" varStatus="i">
							    <form:option value="${item.id}">${item.name}</form:option>
							 </c:forEach>
						</form:select>	    	
			    	</td>
			    </tr>
			    			    	    
			    <tr>
			    	<td><font color=red>*</font> Email</td>
			    	<td><form:input path="email" size="40" />
			    	 <div class="errors"><form:errors path="email"/></div>
			    	</td>
			    	
			    </tr>
		
			    <tr>
			    	<td>Alternate Email </td>
			    	<td><form:input path="alternateEmail" size="40" /></td>
			    </tr>
		
			    <tr>
			    	<td><font color=red>*</font> Password</td>
			    	<td>
			    		<form:password path="password" size="40" />
			    		<div class="errors"><form:errors path="password"/></div>
			    	</td>
			    </tr>
			    
			    <tr>
			    	<td><font color=red>*</font> Confirm password</td>
			    	<td>
			    		<form:password path="confirmPassword" size="40" />
			    		<div class="errors"><form:errors path="confirmPassword"/></div>
			    	</td>
			    </tr>
		
			    <tr>
			    	<td>Active</td>
			    	<td>
			    		<form:checkbox path="enabled" />
			    	</td>
			    </tr>
			    	    	    	    
				<tr><td colspan="2">&nbsp;</td></tr>
			    
				<tr>
					<td colspan="2" align="center">
						<input type="submit" class='ui-button ui-state-default ui-corner-all' id="updatePayee" value="Save" />						
						<input type="button" class='ui-button ui-state-default ui-corner-all' value="Cancel" onclick="location.href='view_payees.htm'" />
					</td>
				</tr>
		   	</table>
	   	</form:form>
	   	</td>
	   	</tr>
	</table>	
</td>
</tr>

<script language="javascript">
	function validatePassword() {
		var password1 = document.getElementById("password").value;
		var password2 = document.getElementById("confirmPassword").value;
		
		if (password1 != password2) {
			alert("Please enter password and confirm password the same value");
			return false;
		}
		return true;
	}
</script>
</table> </div>	</div>
<%@include file="/WEB-INF/jsp/include/footer.jsp"%></body>
</html>
